<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<script type="text/javascript">
jQuery(document).ready(
  function(){
    jQuery("#adminForm").validate({
      rules:  {
        name: "required",
        pic_url: "required"
      }
    });
  }
);
</script>
  <fieldset class="adminform">
    <legend>Details</legend>
      <?
        $id       = 0;
        $name       = null;
        $address   = null;
        $google_map  = null;
        $description = null;
        $published    = true;
        
        if(isset($this->venue)){
          $id       = $this->venue->id;
          $name      = $this->venue->name;
          $address   = $this->venue->address;
          $google_map  = $this->venue->google_map;
          $pic_id     = $this->venue->pic_id;
          $published    = $this->venue->published;
        }
        
		$pic_id        = null;
        $pic_flickr_id = null;
        $pic_url       = null;
        if($this->pic){
          $pic_id        = $this->pic->id;
          $pic_flickr_id = $this->pic->flickr_id;
          $pic_url       = PBNYHelper::getFlickrImageUrl($pic_flickr_id);
        }
      ?>
      
            <table class="admintable">
        <tr>
          <td></td>
          <td><img src="<?= PBNYHelper::getFlickrImageUrl($pic_flickr_id) ?>"/></td>
        </tr>
        <tr>
          <td class="key">Url</td>
          <td>
            <input type="hidden" id="old_pic_url" name="old_pic_url" value="<?= $pic_url ?>"/>
            <input type="hidden" id="pic_flickr_id" name="pic_flickr_id" value="<?= $pic_flickr_id ?>"/>
            <textarea id="pic_url" name="pic_url" rows="2" cols="40"><?= $pic_url ?></textarea>
          </td>
        </tr>
        <tr>
          <td class="key">Embed Google Map</td>
          <td>
            <textarea id="google_map" name="google_map" rows="6" cols="40"><?= $google_map ?></textarea>
          </td>
        </tr>
                <tr>
                    <td class="key">Name</td>
          <td>
            <input type="text" name="name" id="name" value="<?= $name ?>" />
          </td>
        </tr>
                <tr>
                    <td class="key">Address</td>
          <td>
            <?= $this->editor->display( 'address', $address, '100%', '150', '40', '5' ) ?>
          </td>
        </tr>      
        <tr>
          <td class="key">Published</td>
          <td>
            <?= JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $published); ?>
          </td>
        </tr>
             </table>
       </fieldset>
       <input type="hidden" name="option" value="<?= JRequest::getVar( 'option' );?>"/>
       <input type="hidden" name="c" value="<?= JRequest::getVar('c', 'position'); ?>" />
       <input type="hidden" name="id" value="<?= $id; ?>"/>
       <input type="hidden" name="pic_id" value="<?= $pic_id; ?>"/>
       <input type="hidden" name="task" value=""/>
</form>
